package com.iafme.utils;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import com.iafme.constants.CodeConstants;

/**
 * @author summer
 * @version 1.0
 * @date 2025/3/22 17:23
 */
public class AdmissionNumUtil {

    public static String admissionNum(){
        String random = RandomUtil.randomString("0123456789",5);
        return DateUtil.format(new DateTime(),"yyyyMM")+random;
    }


    public static String orderNum(){
        String random = RandomUtil.randomString("0123456789",6);
        return DateUtil.format(new DateTime(),"yyyyMMdd")+random;
    }

     public static String redemptionNum(){
       return RandomUtil.randomString(CodeConstants.ADMISSION_NUM_PREFIX,8);
    }

    public static void main(String[] args) {
       String aa="key:redemption:cc5ea42fbe764cb8a3fc46fd8253c565";
       System.out.println(StrUtil.subAfter(aa,"redemption:",true));
    }
}
